<div ng-controller="WxappCtrl" ng-init="addAction()" class="sui-form form-horizontal">
    <ul class="sui-breadcrumb">
        <li><a href="#/wxapp/list">{{'小程序'| translate}}</a></li>
        <li class="active">
            {{wxapp.appid?"编辑":"创建"|translate}}
        </li>
    </ul>
    <form name="xform" novalidate ng-submit="save()">
        <div class="control-group">
            <label class="control-label v-top">{{'小程序'|translate}}：</label>
            <div class="controls">
                <input ng-model="wxapp.app_type" type="radio" name="app_type" ng-value="1"> 黄蜂商城
            </div>
        </div>
        <div class="control-group">
            <label class="control-label v-top">{{'status'|translate}}：</label>
            <div class="controls">
                <wxapp-statu ng-model="wxapp.statu"></wxapp-statu>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label v-top">{{'模板号码'|translate}}：</label>
            <div class="controls">
                <input ng-model="wxapp.template_id" type="number" name="template_id" class="input-xlarge" required>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label v-top">{{'版本'|translate}}：</label>
            <div class="controls">
                <input ng-model="wxapp.version" type="text" name="version" class="input-xlarge" required>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label v-top">{{'描述'|translate}}：</label>
            <div class="controls">
                <input ng-model="wxapp.description" type="text" name="description" class="input-xlarge" required>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label"></label>
            <div class="controls">
                <button type="submit" class="sui-btn btn-primary" ng-disabled="!xform.$valid">
                    {{'save' | translate}}
                </button>
            </div>
        </div>
    </form>
    <!-- wxapptempleTab -->
    <wxapptemple-tab ng-model="templetype" click-tab="gettempleList()"></wxapptemple-tab>
    <table class="sui-table table-bordered">
        <thead>
            <tr>
                <th>{{'小程序'|translate}}</th>
                <th>{{'发布模板ID'|translate}}</th>
                <th>{{'版本'|translate}}</th>
                <th>{{'描述'|translate}}</th>
                <th>{{'操作'|translate}}</th>
            </tr>
        </thead>
        <tbody>
            <tr ng-repeat="list in wxapps">
                <td>
                    {{list.source_miniprogram}}
                </td>
                <td>{{list.draft_id}}{{list.template_id}}</td>
                <td>{{list.user_version}}</td>
                <td>{{list.user_desc}}</td>
                <td>
                    <!-- <a href="#/wxapp/add?appid={{list.appid}}" class="sui-btn btn-primary">{{'edit'|translate}}</a> -->
                    <button ng-show="list.draft_id" class="sui-btn btn-success" ng-click="addtotemplate(list.draft_id)">上传到模板</button>
                    <button ng-show="!list.draft_id" class="sui-btn btn-primary" ng-click="copy(list.template_id,2)">正式发布</button>
                    <button ng-show="!list.draft_id" class="sui-btn btn-primary" ng-click="copy(list.template_id,1)">发布草稿</button>
                    <button ng-show="!list.draft_id" class="sui-btn btn-danger" ng-click="del(list.template_id)">删除</button>
                    <!-- <a href="#/wxapp/fabulist?template_id={{list.template_id}}" class="sui-btn btn-primary">{{'发布日志'|translate}}</a> -->
                </td>
            </tr>
        </tbody>
    </table>
</div>